package com.tsd.jxc.stock.service;

import com.tsd.core.vo.PageBean;
import com.tsd.jxc.buy.entity.JxcBuyOrderExt;
import com.tsd.jxc.buy.entity.JxcBuyReturnBillExt;
import com.tsd.jxc.sale.entity.JxcSaleOrderExt;
import com.tsd.jxc.sale.entity.JxcSaleReturnBillExt;
import com.tsd.jxc.stock.entity.JxcStockGoods;
import com.tsd.jxc.stock.entity.JxcStockGoodsExt;
import com.tsd.jxc.stock.vo.JxcStockGoodsVo;
import com.tsd.system.entity.SysUser;

import java.util.List;
import java.util.Map;

/**
 * 描述：JxcStockGoods服务实现层接口
 *
 * @author Hillpool
 * @date 2022/07/29 15:06:33
 */
public interface JxcStockGoodsService {

    /**
     * 描述：根据id获取JxcStockGoods
     *
     * @param id
     */
    JxcStockGoods getJxcStockGoodsById(Long id) throws Exception;

    /**
     * 描述：根据sid获取JxcStockGoods
     *
     * @param sid
     */
    JxcStockGoodsExt queryBySid(String sid) throws Exception;

    /**
     * 描述：根据sid列表删除JxcStockGoods
     *
     * @param list
     */
    void deleteJxcStockGoodss(List<String> list, SysUser opUser) throws Exception;

    /**
     * 描述：保存或更新JxcStockGoods
     *
     * @param record
     * @param opUser
     */
    void saveJxcStockGoods(JxcStockGoods record, SysUser opUser) throws Exception;

    /**
     * 初始化库存
     *
     * @param goods_sid_list
     * @param opUser
     * @throws Exception
     */
    void initJxcStockGoods(List<String> goods_sid_list, SysUser opUser) throws Exception;

    /**
     * 描述：根据params分页查询JxcStockGoods
     *
     * @param params
     * @param page
     */
    List<JxcStockGoodsExt> findJxcStockGoodss(Map<String, Object> params, PageBean page) throws Exception;

    List<JxcStockGoodsVo> findJxcStockGoods4Clothing(Map<String, Object> params, PageBean page) throws Exception;

    /**
     * 描述：根据params分页查询JxcStockGoods
     *
     * @param params
     */
    List<JxcStockGoodsExt> findJxcStockGoodss(Map<String, Object> params) throws Exception;

    List<JxcStockGoodsExt> queryByEntity(JxcStockGoodsExt params);

    /**
     * 描述：根据params分页查询JxcStockGoods
     *
     * @param params
     */
    List<JxcStockGoodsExt> getAllGoods(Map<String, Object> params) throws Exception;

    /**
     * 描述：根据商品sid，获取库存
     *
     * @param goods_sid
     * @return
     */
    List<JxcStockGoodsExt> getJxcStockGoodsListByGoodsSid(String goods_sid);

    /**
     * 描述：导入Excel商品库存
     *
     * @param list
     * @param opUser
     */
    void batchImportStockGoods(List<JxcStockGoodsVo> list, SysUser opUser) throws Exception;

    /**
     * 描述：根据sid列表更新JxcStockGoods
     *
     * @param list
     */
    void updateJxcStockGoodss(List<Map> list, SysUser opUser) throws Exception;

    /**
     * 根据销售订单更新库存
     *
     * @param addOrSub
     * @param saleOrderExt
     * @throws Exception
     */
    void updateBySaleOrder(int addOrSub, JxcSaleOrderExt saleOrderExt);

    /**
     * 根据销售退货订单更新库存
     *
     * @param addOrSub
     * @param returnBillExt
     * @throws Exception
     */
    void updateBySaleReturnBill(int addOrSub, JxcSaleReturnBillExt returnBillExt);

    /**
     * 根据采购订单更新库存
     *
     * @param addOrSub
     * @param buyOrderExt
     * @throws Exception
     */
    void updateByBuyOrder(int addOrSub, JxcBuyOrderExt buyOrderExt);

    /**
     * 根据采购退货订单更新库存
     *
     * @param addOrSub
     * @param returnBillExt
     * @throws Exception
     */
    void updateByBuyReturnBill(int addOrSub, JxcBuyReturnBillExt returnBillExt);
}
